package org.springsecuritylearn.admin.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springsecuritylearn.admin.interceptor.TimeInterceptor;

/**
 * @author hyf
 * @Title: ${file_name}
 * @Package org.springsecuritylearn.admin.config
 * @Description: ${todo}
 * @date 2018/5/6上午9:48
 */
@Configuration
public class WebConfig  extends WebMvcConfigurerAdapter {

    @Autowired
    private TimeInterceptor timeInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        super.addInterceptors(registry);
        registry.addInterceptor(timeInterceptor);

    }
}
